package com.guan.core;

import com.guan.core.entity.ReturnContent;
import com.guan.core.util.ReturnType;

/**
 * 视图模型
 * Created by Administrator on 2018/1/16 0016.
 */
@SuppressWarnings("all")
public class CustomView {
    private ReturnContent returnContent;
    private ReturnType returnType;

    public CustomView(ReturnContent returnContent) {
        this.returnContent = returnContent;
        if(null == returnContent.getUrl()){
            this.returnType = ReturnType.JSON;
        }else{
            this.returnType = ReturnType.FORWORD;
        }
    }

    public CustomView(String viewName) {
        returnContent = new ReturnContent(viewName);
        returnType = ReturnType.FORWORD;
    }

    public CustomView(ReturnContent returnContent, ReturnType returnType) {
        this.returnContent = returnContent;
        this.returnType = returnType;
    }

    public ReturnContent getReturnContent() {
        return returnContent;
    }

    public void setReturnContent(ReturnContent returnContent) {
        this.returnContent = returnContent;
    }

    public ReturnType getReturnType() {
        return returnType;
    }

    public void setReturnType(ReturnType returnType) {
        this.returnType = returnType;
    }
}
